package com.tk.exam.resolver;

import com.tk.exam.interceptor.RequestHeaderValidatorInterceptor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;


@Configuration
public class ClientResourcesConfig implements WebMvcConfigurer {
    /**
     * 日志拦截器
     */
    @Autowired
    private RequestHeaderValidatorInterceptor requestHeaderValidatorInterceptor;

    /**
     * 配置拦截器
     *
     * @param registry
     */
    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(requestHeaderValidatorInterceptor).addPathPatterns("/**");
    }

}